<?php
/**
 *
 * @author		Joachim Ruf, Loresoft Software (http://www.loresoft.de)
 * @license		New BSD License
 * @version		Class for Bootstrap v2.3.2
 *
 * */


Class Bootstrap_Formular_Row
{
	private $desc;
	private $arrElement		= array();


	/**
	 *
	* */
	function __construct ($_desc = NULL) {
		$this->desc = $_desc;
	}


	/**
	 * Liefert eine Zeile zurueck.
	 * @param int $i	: Auszugebende Zeile
	 * @return void
	 * */
	public function addElement ($_element, $_desc = NULL, $_prepend = NULL, $_append = NULL) {
		return $this->arrElement[] = new Bootstrap_Formular_Element($_element, $_desc, $_prepend, $_append);
	}


	public function display () {
		$content	= '';
		$desc		= '';

		if (count($this->arrElement)) {
			/* @var $element V24_FormElement */
			foreach ($this->arrElement as $key => $element) {
				$content .= $element->display();
			}
		}

		if ($this->desc !== NULL) {
			$desc = '<label class="control-label"><b>'.$this->desc.'</b></label>';
		}

		return '<div class="control-group">
					'.$desc.'
					<div class="controls form-inline">
						'.$content.'
					</div>
				</div>';

	}

}


?>